package dbms;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnection{

	protected static Connection CONNECTION;
	
	public static Connection createConnection()
	{
		try {
			return DriverManager.getConnection("jdbc:h2:db/db_server", "neb", "neb");
		} catch (SQLException e) {
			// TODO: Eccezione
			e.printStackTrace();
			return null;
		}
	}
	
	public static Connection getIstance()
	{
		if(CONNECTION == null) CONNECTION = DBConnection.createConnection();
		
		return CONNECTION;
	}
	
}
